<?php
namespace app\admin\validate;
use think\validate;

class Admin extends Validate
{  
    protected $rule=[
        'username'=>'require|max:25|unique:admin',
        'password'=>'require|max:33',
    ];

    protected $message = [
        'username.require'=>'小可爱名称必须填写哦',
        'username.max' =>'小可爱名称长度不可以大于25位哦~~~~',
        'username.unique'=>'名称不可重复',
        'password.require' =>'小可爱密码必须填写~~~~~~',

    ];

    protected $scene = [
        'add'=>['username','password'],
        'edit'=>['username'],
    ];
}

?>